/*
    Autor: David Roberto Bellomo Gomez
    Nombre: App_IRS.h
    Descripción: Implementación de las ISR
    Modificaciones:
    Fecha:
    Nota:
*/
#include "PearlScopeV1.h"
extern byte Flag_Send;
/*
  Nombre: ISR de ADC convertion
  Par�metros: none
  Regresa:  none
  Descrici�n: ISR de ADC
  Modificaciónes:
  Fecha:
  Nota:
*/

ISR(ADC_vect){
	// When ADCL is read, the ADC Data Register is not updated until ADCH
	// is read. Consequently, if the result is left adjusted and no more
	// than 8-bit precision is required, it is sufficient to read ADCH.
	// Otherwise, ADCL must be read first, then ADCH.
          ADCSampleBuffer[ADC_Sample_Counter] = ADCH;
          ADC_Sample_Counter = (ADC_Sample_Counter + 1) % SAMPLEBUFFERSIZE;
          if( 0 == ADC_Sample_Counter )
          Flag_Send = 1;
           

}
